package com.itheima.day11.bytestream.test6;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream("myCode\\src\\com\\itheima\\day11\\a.txt");
            int read;
            while ((read = fis.read()) != -1) {
                System.out.print((char) read);
            }
        } catch (FileNotFoundException e) {
            System.out.println("没找到文件");
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fis != null)
                try {
                    System.out.println("\n释放资源");
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
        }
    }
}
